package mysql

import "gorm.io/gorm"

type Type struct {
	gorm.Model
	Typename string `gorm:"type:varchar(20);not null;comment:类型名称"`
}

func (t *Type) TypeShow(db *gorm.DB, types string) error {
	return db.Debug().Where("typename=?", types).First(&t).Error
}

func (t *Type) TypeAdd(db *gorm.DB) error {
	return db.Debug().Create(&t).Error
}
